<?php
/**
 * @copyright TinyWEB CMS
 * @link http://tinywebcms.ru
 * @link http://cms.vingrad.ru
 *
 */
abstract class Object
{
    protected $namespace = 'Object';
    
    final protected function setNamespace($namespace)
    {
        $this->namespace = ($namespace ? $namespace : $this->namespace);
    }
    
    final public function getNamespace($namespace = null)
    {
        return $namespace ? $namespace : $this->namespace;
    }
    
    /**
     * Возвращает свойство.
     *
     * @param string $path
     * @param mixed $default
     * @return ConfigProperty
     */
    final protected function getProperty($property = null, $default = null)
    {
        return Config::get($property, $this->namespace);
    }
    
    protected function defaults() {}
}

?>